package com.khy.service.impl;

import com.khy.mapper.TbAdminMapper;
import com.khy.pojo.UserInfo;
import com.khy.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Admins implements AdminService {
    @Autowired
    private TbAdminMapper adminMapper;
    @Override
    public List<UserInfo> selectt() {
        List<UserInfo> list = adminMapper.selectAll();
        if (list != null && list.size() > 0) {
            return list;
        }
        return null;
    }

    @Override
    public UserInfo select(UserInfo userInfo) {
        UserInfo u = adminMapper.select(userInfo);
        return u;
    }

    @Override
    public int delete(int id) {
        int a = adminMapper.delete(id);
        return a;
    }

    @Override
    public int add(UserInfo userInfo) {
        int a = adminMapper.add(userInfo);
        return a;
    }

    @Override
    public UserInfo se(int id) {
        UserInfo u = adminMapper.se(id);
        return u;
    }

    @Override
    public int update(UserInfo userInfo) {
        int ont = adminMapper.update(userInfo);
         return ont;
    }



   /* @Autowired
    private TbAdminMapper adminMapper;
*/

  /*  @Override
    public List<UserInfo> selectt() {
        List<UserInfo> list = adminMapper.selectAll();
        if (list != null && list.size() > 0) {
            return list;
        }
        return null;
    }*/


}
